package com.yhxt.controller;

import com.bizzan.bitrade.util.MessageResult;
import com.yhxt.dto.UnbindDto;
import com.yhxt.eneity.Controct;
import com.yhxt.service.ContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author zjh
 * @Description 合约
 * @Date $ $
 * @Param $
 * @return $
 */

@RestController
@RequestMapping("/contract")
public class ContractController {

    @Autowired
    private ContractService contractService;

    /**
     * 三十天合约
     */
    @PostMapping("/thirty_contract")
    public MessageResult thirtyContract(Controct controct,int number){
        contractService.thirtyContract(controct,number);
        return MessageResult.success();
    }

    /**
     * 60天合约
     */
    @PostMapping("/sixty_contract")
    public MessageResult sixtyContract(Controct controct,int number){
        contractService.sixtyContract(controct,number);
        return MessageResult.success();
    }

    /**
     * 90天合约
     */
    @PostMapping("/nonety_contract")
    public MessageResult nonetyContract(Controct controct,int number){
        contractService.nonetyContract(controct,number);
        return MessageResult.success();
    }
    /**
     * 120天合约
     */
    @PostMapping("/twelve_contract")
    public MessageResult twelveContract(Controct controct,int number){
        contractService.twelveContract(controct,number);
        return MessageResult.success();
    }

    /**
     *
     *
     * 解约
     */
    @PostMapping("/unbind")
    public MessageResult unbind(UnbindDto dto){
        contractService.unbind(dto);
        return MessageResult.success();
    }



}
